#ifndef USERLIST_H
#define USERLIST_H

#include <QWidget>
#include <QNetworkAccessManager>
#include <QNetworkReply>

namespace Ui {
class UserList;
}

class QStandardItemModel;

class UserList : public QWidget
{
    Q_OBJECT
    
public:
    explicit UserList(QWidget *parent = 0);
    ~UserList();
    
public slots:
    void    onAddGroup();
    void    onDeleteGroup();
    void    onSelectGroup();
    void    onAddUser();
    void    onNavigateFirst();
    void    onNavigatePre();
    void    onNavigateNext();
    void    onNavigateLast();
    void    onNavigate();
    void    onDeleteUsers();
    void    onClearUsers();
    void    onInputUsers();
    void    onSearch();

public:
    void    initGroupList();
    void    clearTables();
    void    showUserLists(int gid, int page);
    void    showNavigate(int page, int all, int pagesize);
    int     getCurrentGroup();
    int     getCurrentPage();

private:
    Ui::UserList            *ui;
    QStandardItemModel      *m_items;
    QNetworkAccessManager   *m_manager;
    QString                 m_search;
    //QNetworkReply           *m_reply;
};

#endif // USERLIST_H
